cd <old-server-install-dir>/bin ./rhq-server.bat remove
If you already have a RHQ Server installed and wish to re-install it or upgrade it, please follow the steps outlined below.
When upgrading the RHQ Server, you must ensure the RHQ Agents are also upgraded at the same time. Servers and agents must be at the same version level. The agent has an auto-update feature to help upgrade agents automatically.
Loss of minimal monitoring data is inevitable given the down-time involved in shutting down instances of the RHQ Agents during the upgrade process. In addition, if you have a resource in inventory corresponding to the RHQ Server itself, upgrading RHQ will entail the loss of all data for that RHQ Server resource.
It is most efficient to remove "out of service" platform resources prior to the upgrade. If you have machines that you are no longer going to monitor (or have already stopped monitoring), you'll want to stop the RHQ Agents running on those machines and uninventory their respective platforms.
Stop all of the RHQ Agents and wait for them to fully shutdown
RHQ 2.2 has added the ability for its agents to auto-upgrade themselves. So once you install RHQ 2.2, you will find that upgrading the agents thereafter will be simpler, because the agent will be able to detect when a server has been upgraded and the agent will upgrade itself accordingly. Therefore, if you have prepared your agents for auto-update, you will not want to shut them down. Let them detect when the new RHQ Server comes online and upgrade themselves.
Stop the RHQ Server after the agents are down.
If you are running the RHQ Server on Windows and installed the original RHQ Server as a Windows service, uninstall the Windows service:
cd <old-server-install-dir>/bin ./rhq-server.bat remove
Make sure you do not stop the RHQ database - ensure it is still running.
Unzip the distribution to the directory within which it will be executed from, e.g.:
cd /opt unzip jopr-server-2.2.0.zip
The new Server installation should not be copied on top of a previous RHQ Server installation.
The directory structure within the zipfile ensures the new Server has a version-specific installation directory name (e.g. the above commands will create a directory named /opt/jopr-server-2.2.0).
If you have made modifications to your original RHQ Server's Startup Properties (e.g. enabling SSL, configuring SMTP, etc.), you must merge your changes in with the new RHQ Server's bin/rhq-server.properties file. If you prefer not to edit the new server's bin/rhq-server.properties file, you can merge your changed values during installation via the "Advanced Settings" checkbox in the Installer UI.
You should consider backing up your database prior to proceeding. In case problems arise during the database upgrade, having a backup will allow you to restore to your previous state.
Follow the rest of the install documentation to complete the upgrade. Once you've entered your database connection info, the installer should detect that there is an existing RHQ database and display the following prompt: A database schema already exists. What do you want to do?. Choose the default, "Keep (maintain existing data)". Do not choose "Overwrite (lose existing data)", otherwise all of the existing inventory, metric, and history data from your original RHQ installation will be lost.
During the upgrade you may see error messages similar to the following in the console. These error messages are harmless.
ERROR [ClientCommandSenderTask] {ClientCommandSenderTask.send-failed}Failed to send command [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.timeout=1000, rhq.send-throttle=true}]; params=[{targetInterfaceName=org.rhq.enterprise.communications.Ping, invocation=NameBasedInvocation[ping]}]]. Cause: org.jboss.remoting.CannotConnectException:[.....]
Follow the Manually Upgrading the Agent instructions if you need to manually upgrade your agents. If your agents will auto-update themselves, you don't have to do anything for this step.
You can now begin to start up your RHQ Servers. Once they are up, you can begin to start your RHQ Agents if they need to be started.
If a RHQ Server Resource corresponding to your old RHQ Server installation is in the inventory, remove it from the inventory.
(optional) If desired, import the new RHQ Server resource into the inventory.